import { fliterPermission } from '@/utils/sys.js'
export const apis = {
  list: `business/basis/getList?modelCode=MODEL_QUOTATION&authCode=FUNCTION_QUOTATION_LIST`,
  del: `business/quotation/del?authCode=BTN_QUOTATION_DEL`,
  add: `business/quotation/add?authCode=BTN_QUOTATION_ADD`,
  edit: `business/quotation/edit?authCode=BTN_QUOTATION_EDIT`,
  detail: `business/quotation/detail?modelCode=MODEL_QUOTATION&authCode=BTN_QUOTATION_DETAIL`,
  
};

export const configs = {
  listUrl: apis.list,
  pageOn: true, // 开启分页
  searchOn: true, // 开启搜索
  operateOn: true, //开启操作区域
  treeOn: false, // 开启树形
};


export const searchs = [
  {
    type: "Input",
    column: "transport_type_name",
    label: "名称",
  },
 
  {
    type: "DatePicker",
    column: "ctime",
    label: "创建日期",
  },
];

export const pages = {
  pageSize: 20,
  orders: [
    {
      field: "id",
      sort: "desc",
    },
  ]
};
export const columns = [
  { type: "selection" },
  // {
  //   label: "ID",
  //   column: "id",
  //   sortable: "custom",
    
  // },
  {
    label: "名称",
    column: "quotation_name",
    display: "text",
  },
  {
    label: "抛重系数",
    column: "quotation_throwing_weight",
    display: "text",
  },
  {
    label: "最低消费",
    column: "quotation_min",
    display: "text",
  },
  {
    label: "比重系数",
    column: "quotation_proportion",
    display: "text",
  
  },
  
  {
    label: "创建时间",
    column: "ctime",
    format: "datetime",
    display: "text",
  },
  { label: "操作", column: "operate", width: "240", fixed: "right" },
];

export const buttons = fliterPermission([
  {
    operate: "add",
    text: "新增",
    permission: 'BTN_QUOTATION_ADD',
  },

]);
export const columnButtons = fliterPermission([
  {
    operate: "detail",
    text: "详情",
    permission: 'BTN_QUOTATION_DETAIL',
  },
  {
    operate: "edit",
    text: "编辑",
    permission: 'BTN_QUOTATION_EDIT',
    

  },
  {
    operate: "delete",
    text: "删除",
    permission: 'BTN_QUOTATION_DEL',
    type: 'danger',
    hidden: ({ row })=> {
      if(['1'].includes(row.quotation_default)){
        return true
      }
      return false
    },
  }
]);
